It is known to provide a shading device for a glazed vehicle opening having a pull-out bar, which is guided in opposite guide rails, and a shading element, which is mounted on the pull-out bar and which can be adjusted between a retracted position and an extended position by sliding the pull-out bar along the guide rails. A shading device of this kind in the form of a roller sun blind for a vehicle is described in DE 20 2007 018 180 U1, for example. The known roller sun blind comprises a pull-out bar in the form of a pulling hoop guided in opposite guide rails, on which a shading element designed as a roller blind web is mounted. The roller blind web is wound onto a winding shaft preloaded counter to a pull-out direction. In order to be able to lock the roller sun blind in a particular extended position, the frictional forces acting between the pull-out bar and the guide rails must be dimensioned in such a way that they are always greater than the restoring force exerted on the pull-out bar by the preloaded winding shaft via the roller blind web. However, the frictional forces between the pull-out bar and the guide rails decrease over time due to wear, and it is therefore no longer possible to ensure reliable locking, precisely when shocks related to driving occur. Moreover, the pull-out bar tends, if actuated carelessly, to skew in the guide rails and, in the worst case, to jump out of the rails.